﻿<Window x:Class="Gao.Poker.App.Win.SendSmsHistoryWin"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Domain="clr-namespace:Gao.Poker.Domain;assembly=Domain" Title="短信发送历史" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
    <Grid Margin="5">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="6*"/>
            <ColumnDefinition Width="4*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="5"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <ListView Grid.Column="0" Grid.Row="1"
            Name="listView" Margin="0" DockPanel.Dock="Top" ItemsSource="{Binding Path=SendSmses}" 
                      SelectedItem="{Binding Path=SendSms}" Padding="0"
              VirtualizingStackPanel.VirtualizationMode="Recycling">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <Grid Margin="2">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <StackPanel Grid.Column="0" Grid.ColumnSpan="2" Margin="0">
                            <TextBlock Text="{Binding Path=SendContent}" />
                            <TextBlock Text="{Binding Path=Suffix}" />
                            <TextBlock Text="{Binding Path=CreateDate, StringFormat='yyyy-MM-dd'}"
                                        TextTrimming="CharacterEllipsis" />
                        </StackPanel>
                    </Grid>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

        <DataGrid  Grid.Column="1" Grid.Row="1" Margin="0" RowHeight="30" Name="dgRight"  AutoGenerateColumns="False" IsReadOnly="True"
                      SelectionMode="Extended"  CanUserAddRows="True" CellStyle="{StaticResource Body_Content_DataGrid_Centering}"
                      AlternatingRowBackground="Gainsboro" ItemsSource="{Binding Path=SendSms.SendSmsMembers}"  AlternationCount="2"
                      FontSize="16" Height="Auto">
            <DataGrid.Columns>
                <DataGridTextColumn Header="姓名" Width="100" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=Name}"/>
                <DataGridTextColumn Header="手机号" Width="*" HeaderStyle="{StaticResource CenterAlignmentColumnHeaderStyle}" Binding="{Binding Path=Telephone}"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Window>
